load("@rules_proto//proto:defs.bzl", "proto_library")

exports_files(["buf_image.json"])

proto_library(
    name = "api_proto",
    srcs = ["api.proto"],
    import_prefix = "examples/proto",
    visibility = ["//visibility:public"],
    deps = [":place_proto"],
)

proto_library(
    name = "person_proto",
    srcs = ["person.proto"],
    import_prefix = "examples/proto",
    visibility = ["//visibility:public"],
    deps = [":place_proto"],
)

proto_library(
    name = "place_proto",
    srcs = ["place.proto"],
    import_prefix = "examples/proto",
    visibility = ["//visibility:public"],
    deps = [":thing_proto"],
)

proto_library(
    name = "thing_proto",
    srcs = ["thing.proto"],
    import_prefix = "examples/proto",
    visibility = ["//visibility:public"],
    deps = [
        "@protobuf//:any_proto",
    ],
)

proto_library(
    name = "routeguide_proto",
    srcs = ["routeguide.proto"],
    import_prefix = "examples/proto",
    visibility = ["//visibility:public"],
)

filegroup(
    name = "routeguide_features",
    srcs = ["routeguide_features.json"],
    visibility = ["//visibility:public"],
)

proto_library(
    name = "greeter_grpc",
    srcs = [
        "greeter.proto",
    ],
    import_prefix = "examples/proto",
    visibility = ["//visibility:public"],
    deps = [
        ":thing_proto",  # Non well-known
        "@protobuf//:any_proto",  # Well-known
    ],
)
